package week1;

/**
 * Created by Administrator on 2017/9/9.
 */
public class Singleton {
    private static Singleton obj;

    public static Singleton getInstance() {
        if( obj == null ) {
            obj = new Singleton();
        }
        return obj;
    }

    private Singleton() {}

    public void fun() {
        System.out.println("fun in Singleton");
    }
}
